# -*- coding: utf-8 -*-
"""
Created on Mon Dec 16 13:31:12 2024

@author: 35139
"""

def find_zero_positions(matrix):
    def backtrack(row, col, positions):
        if row == n or col == n:
            return True
        for i in range(n):
            for j in range(n):
                if matrix[i][j] == 0 and (i, j) not in positions:
                    positions.append((i, j))
                    matrix[i][j] = 1
                    if backtrack(row + 1, col + 1, positions):
                        return True
                    positions.remove((i, j))
                    matrix[i][j] = 0
        return False

    n = len(matrix)
    positions = []
    if backtrack(0, 0, positions):
        return positions
    else:
        return None

# 示例矩阵
matrix = [
    [0, 1, 0],
    [1, 0, 1],
    [0, 1, 1]
]

print(find_zero_positions(matrix))